package cn.com.cifi.mars.bean.dto;

import cn.com.cifi.mars.util.NumberUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 年初存货,年度新供,年度综合
 * @author Administrator
 *
 */
@Data
@ApiModel(value = "年初存货,年度新供,年度综合", description = "年初存货,年度新供,年度综合")
public class YearDepositNewSupplyDto {

    @ApiModelProperty(name = "c_earlyInventoryNum", value = "年初存货套数")
    private String c_earlyInventoryNum;
    @ApiModelProperty(name = "c_earlyInventoryAmount", value = "年初存货金额")
    private String c_earlyInventoryAmount;
    @ApiModelProperty(name = "c_actualContractNum", value = "年初存货实际签约套数")
    private String c_actualContractNum;
    @ApiModelProperty(name = "c_actualContractAmount", value = "年初存货实际签约金额")
    private String c_actualContractAmount;
    @ApiModelProperty(name = "c_actualDeChemicalRateAmount", value = "年初存货实际去化率")
    private String c_actualDeChemicalRateAmount;

    @ApiModelProperty(name = "d_supplyPlanNum", value = "年度新供供货计划套数")
    private String d_supplyPlanNum;
    @ApiModelProperty(name = "d_supplyPlanAmount", value = "年度新供供货计划金额")
    private String d_supplyPlanAmount;
    @ApiModelProperty(name = "d_supplyPlanActualNum", value = "年度新供供货实际套数")
    private String d_supplyPlanActualNum;
    @ApiModelProperty(name = "d_supplyPlanActualAmount", value = "年度新供供货实际金额")
    private String d_supplyPlanActualAmount;
    @ApiModelProperty(name = "d_supplyPlanRateAmount", value = "年度新供供货达成率")
    private String d_supplyPlanRateAmount;
    @ApiModelProperty(name = "d_actualContractNum", value = "年度新供实际签约套数")
    private String d_actualContractNum;
    @ApiModelProperty(name = "d_actualContractAmount", value = "年度新供实际签约金额")
    private String d_actualContractAmount;
    @ApiModelProperty(name = "d_actualDeChemicalRateAmount", value = "年度新供实际去化率")
    private String d_actualDeChemicalRateAmount;

    @ApiModelProperty(name = "e_annualSaleNum", value = "年度综合年度可售套数")
    private String e_annualSaleNum;
    @ApiModelProperty(name = "e_annualSaleAmount", value = "年度综合年度可售金额")
    private String e_annualSaleAmount;
    @ApiModelProperty(name = "yearSigningTargetCount", value = "年度签约目标套数")
    private String yearSigningTargetCount;
    @ApiModelProperty(name = "yearSigningTargetAmount", value = "年度签约目标金额")
    private String yearSigningTargetAmount;
    @ApiModelProperty(name = "e_signingPlanNum", value = "年度综合签约计划套数")
    private String e_signingPlanNum;
    @ApiModelProperty(name = "e_signingPlanAmount", value = "年度综合签约计划金额")
    private String e_signingPlanAmount;
    @ApiModelProperty(name = "e_signingActualNum", value = "年度综合签约实际套数")
    private String e_signingActualNum;
    @ApiModelProperty(name = "e_signingActualAmount", value = "年度综合签约实际金额")
    private String e_signingActualAmount;
    @ApiModelProperty(name = "e_signingRateAmount", value = "年度综合签约达成率")
    private String e_signingRateAmount;
    @ApiModelProperty(name = "e_actualDeChemicalRateAmount", value = "年度综合实际去化率")
    private String e_actualDeChemicalRateAmount;
    @ApiModelProperty(name = "e_planDeChemicalRateAmount", value = "年度综合计划去化率")
    private String e_planDeChemicalRateAmount;

    //计算百分率
    public void calculatedPercentage(){
        // 年初存货实际去化率(年初存货签约实际金额/年初存货金额)
        this.c_actualDeChemicalRateAmount = NumberUtils.pricePercentage(c_actualContractAmount, c_earlyInventoryAmount);
        // 年度新供供货达成率(年度新供供货实际金额/年度新供供货计划金额)
        this.d_supplyPlanRateAmount = NumberUtils.pricePercentage(d_supplyPlanActualAmount, d_supplyPlanAmount);
        // 年度新供实际去化率(年度新供签约实际金额/年度新供供货实际金额)
        this.d_actualDeChemicalRateAmount = NumberUtils.pricePercentage(d_actualContractAmount, d_supplyPlanActualAmount);
        // 年度综合签约达成率(年度综合签约实际金额/年度综合签约计划金额)
        this.e_signingRateAmount = NumberUtils.pricePercentage(e_signingActualAmount, e_signingPlanAmount);
        // 年度实际去化率(年度综合签约实际金额/(年初存货金额+年度新供供货实际金额))
        this.e_actualDeChemicalRateAmount = NumberUtils.pricePercentage(e_signingActualAmount, e_annualSaleAmount);
        // 计划去化率（年度综合签约计划金额 / 年度可售金额）
        this.e_planDeChemicalRateAmount = NumberUtils.pricePercentage(e_signingPlanAmount, e_annualSaleAmount);
    }

}
